<template>
	<view class="content">
		<view class="container">
			<view class="mould" @click="goTo(1)">
				<image src="../../static/images/add.png" mode=""></image>
				<view class="name">创建作业票</view>
			</view>
			<view class="mould" @click="goTo(2)">
				<image src="../../static/images/task.png" mode=""></image>
				<view class="name">作业票任务</view>
			</view>
			<view class="mould" @click="goTo(3)">
				<image src="../../static/images/todo.png" mode=""></image>
				<view class="name">待办</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				
			}
		},
		methods:{
			goTo(index){
				switch(index){
					case 1:
					uni.navigateTo({
						url: `/work/index`,
						success(res) {
							console.log('成功啦', res);
						},
						fail(err) {
							console.log('失败啦', err);
						}
					});
					 break;
					 case 2:
					 uni.navigateTo({
					 	url: `/work/task`,
					 	success(res) {
					 		console.log('成功啦', res);
					 	},
					 	fail(err) {
					 		console.log('失败啦', err);
					 	}
					 });
					 break;
					 case 3:
					 uni.navigateTo({
					 	url: `/work/todo`,
					 });
					 break;
				}
			}
		}
	}
</script>

<style scoped lang="scss">
	.container{
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		// margin-top: 50rpx;
	}
	.mould{
		width: 50%;
		height: 200rpx;
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
	image{
		width: 100rpx;
		height: 100rpx;
	}
	.name{
		margin-top: 10rpx;
		color: #585858;
	}
</style>
